<style>
    #userFace {
        width: 300px;
        height: 200px;
        margin-top: 20px;
        cursor: pointer;
        box-shadow: 0 0 50px #44576b;
    }
    .user_right{text-align: center;}
</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <form class="layui-form layui-row" lay-filter="form">
                    <input name="id" type="hidden"/>
                    <div class="layui-card-body" pad15>
                        <div class="layui-col-md4 layui-col-xs12">
                            <div class="layui-form-item">
                                <label class="layui-form-label">用户名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="username" disabled class="layui-input layui-disabled">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label layui-form-required">真实姓名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="realname" placeholder="请输入真实姓名" lay-verify="required"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item" >
                                <label class="layui-form-label required">性别</label>
                                <div class="layui-input-block">
                                    <select name="sex" id="sex">
                                        <option value="">请选择</option>
                                        <option value="男">男</option>
                                        <option value="女">女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">身份证号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="identity" placeholder="请输入身份证号" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">手机号码</label>
                                <div class="layui-input-block">
                                    <input type="text" name="tel" placeholder="请输入手机号码" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">个人介绍</label>
                                <div class="layui-input-block">
                                    <textarea name="remarks" placeholder="请填写内容" maxlength="300" class="layui-textarea"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-filter="save" lay-submit>点击保存
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['layer', 'form', 'admin','upload'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var admin = layui.admin;
        var upload = layui.upload;

        //刷新界面 所有元素
        form.render();

        // 回显数据
        form.val('form', data);

        /* 监听表单提交 */
        form.on('submit(save)', function (data) {
            layer.load(2);
            $.post("{:url('owner/editData')}", data.field, function (res) {
                layer.closeAll('loading');
                if (res.code === 200) {
                    layer.msg(res.msg, {icon: 1});
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }, 'json');
            return false;
        });

    });
</script>